package com.heima.behavior.controller.v1;

import com.heima.behavior.service.IApCollectionBehaviorService;
import com.heima.model.behavior.dtos.CollectionBehaviorDTO;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "收藏行为 API")
@RestController
@RequestMapping("api/v1/collection_behavior")
public class ApCollectionBehaviorController {

    @Autowired
    private IApCollectionBehaviorService apCollectionBehaviorService;

    @ApiOperation(value = "处理用户收藏行为", notes = "用户收藏或取消收藏")
    @PostMapping
    public ResponseResult handleCollection(@RequestBody CollectionBehaviorDTO collectionBehaviorDTO){
        return apCollectionBehaviorService.handleCollection(collectionBehaviorDTO);
    }

}
